import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/risk_img_entity.dart';

RiskImgEntity $RiskImgEntityFromJson(Map<String, dynamic> json) {
  final RiskImgEntity riskImgEntity = RiskImgEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    riskImgEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    riskImgEntity.companyId = companyId;
  }
  final int? securityControlRiskPointId = jsonConvert.convert<int>(json['securityControlRiskPointId']);
  if (securityControlRiskPointId != null) {
    riskImgEntity.securityControlRiskPointId = securityControlRiskPointId;
  }
  final String? securityControlRiskPointName = jsonConvert.convert<String>(json['securityControlRiskPointName']);
  if (securityControlRiskPointName != null) {
    riskImgEntity.securityControlRiskPointName = securityControlRiskPointName;
  }
  final int? securityControlActivityId = jsonConvert.convert<int>(json['securityControlActivityId']);
  if (securityControlActivityId != null) {
    riskImgEntity.securityControlActivityId = securityControlActivityId;
  }
  final String? securityControlActivityName = jsonConvert.convert<String>(json['securityControlActivityName']);
  if (securityControlActivityName != null) {
    riskImgEntity.securityControlActivityName = securityControlActivityName;
  }
  final int? confirmPersonId = jsonConvert.convert<int>(json['confirmPersonId']);
  if (confirmPersonId != null) {
    riskImgEntity.confirmPersonId = confirmPersonId;
  }
  final String? confirmPersonName = jsonConvert.convert<String>(json['confirmPersonName']);
  if (confirmPersonName != null) {
    riskImgEntity.confirmPersonName = confirmPersonName;
  }
  final String? description = jsonConvert.convert<String>(json['description']);
  if (description != null) {
    riskImgEntity.description = description;
  }
  final int? reportDeptId = jsonConvert.convert<int>(json['reportDeptId']);
  if (reportDeptId != null) {
    riskImgEntity.reportDeptId = reportDeptId;
  }
  final String? reportDeptName = jsonConvert.convert<String>(json['reportDeptName']);
  if (reportDeptName != null) {
    riskImgEntity.reportDeptName = reportDeptName;
  }
  final String? imgUrl = jsonConvert.convert<String>(json['imgUrl']);
  if (imgUrl != null) {
    riskImgEntity.imgUrl = imgUrl;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    riskImgEntity.createTime = createTime;
  }
  final String? videoUrl = jsonConvert.convert<String>(json['videoUrl']);
  if (videoUrl != null) {
    riskImgEntity.videoUrl = videoUrl;
  }
  return riskImgEntity;
}

Map<String, dynamic> $RiskImgEntityToJson(RiskImgEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['securityControlRiskPointId'] = entity.securityControlRiskPointId;
  data['securityControlRiskPointName'] = entity.securityControlRiskPointName;
  data['securityControlActivityId'] = entity.securityControlActivityId;
  data['securityControlActivityName'] = entity.securityControlActivityName;
  data['confirmPersonId'] = entity.confirmPersonId;
  data['confirmPersonName'] = entity.confirmPersonName;
  data['description'] = entity.description;
  data['reportDeptId'] = entity.reportDeptId;
  data['reportDeptName'] = entity.reportDeptName;
  data['imgUrl'] = entity.imgUrl;
  data['createTime'] = entity.createTime;
  data['videoUrl'] = entity.videoUrl;
  return data;
}

extension RiskImgEntityExtension on RiskImgEntity {
  RiskImgEntity copyWith({
    int? id,
    int? companyId,
    int? securityControlRiskPointId,
    String? securityControlRiskPointName,
    int? securityControlActivityId,
    String? securityControlActivityName,
    int? confirmPersonId,
    String? confirmPersonName,
    String? description,
    int? reportDeptId,
    String? reportDeptName,
    String? imgUrl,
    String? createTime,
    String? videoUrl,
  }) {
    return RiskImgEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..securityControlRiskPointId = securityControlRiskPointId ?? this.securityControlRiskPointId
      ..securityControlRiskPointName = securityControlRiskPointName ?? this.securityControlRiskPointName
      ..securityControlActivityId = securityControlActivityId ?? this.securityControlActivityId
      ..securityControlActivityName = securityControlActivityName ?? this.securityControlActivityName
      ..confirmPersonId = confirmPersonId ?? this.confirmPersonId
      ..confirmPersonName = confirmPersonName ?? this.confirmPersonName
      ..description = description ?? this.description
      ..reportDeptId = reportDeptId ?? this.reportDeptId
      ..reportDeptName = reportDeptName ?? this.reportDeptName
      ..imgUrl = imgUrl ?? this.imgUrl
      ..createTime = createTime ?? this.createTime
      ..videoUrl = videoUrl ?? this.videoUrl;
  }
}